package com.gamehouse.eggpoacher;


import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

public class myMenu extends Activity {
	
	MediaPlayer mpBackground;

	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                WindowManager.LayoutParams.FLAG_FULLSCREEN );
        setContentView(R.layout.main);
        
      //Musica de fundo
        mpBackground = MediaPlayer.create(this, R.raw.musicbackground);
        mpBackground.start();
        mpBackground.setLooping(true);

    }
    
    public void mostrarPlay(View view){
		Intent myIntent = new Intent(view.getContext(), menuPlay.class);
		startActivityForResult(myIntent, 0);
		mpBackground.stop();
		//this.finish();
	}
    
	public void mostrarScores(View view){
		Intent myIntent = new Intent(view.getContext(), myScores.class);
		startActivityForResult(myIntent, 0);
		//this.finish();
	}
	
    public void mostrarOptions(View view){
		Intent myIntent = new Intent(view.getContext(), myOptions.class);
		startActivityForResult(myIntent, 0);
		//this.finish();
	}
    
	public void mostrarHelp(View view){
		Intent myIntent = new Intent(view.getContext(), myHelp.class);
		startActivityForResult(myIntent, 0);
		//this.finish();
	}
	
	public void mostrarAbout(View view)
	{
		Intent myIntent = new Intent(view.getContext(), myAbout.class);
		startActivityForResult(myIntent, 0);
	}
	
	public void onExitClick(View view){
		android.os.Process.killProcess(android.os.Process.myPid());
		mpBackground.stop();
		}
	
	//back button para voltar a actividade anterior e matar a activity actual
	@Override
	public void onBackPressed() {
		android.os.Process.killProcess(android.os.Process.myPid());
		mpBackground.stop();
	}

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
	}

	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
	}

	@Override
	protected void onRestart() {
		// TODO Auto-generated method stub
		super.onRestart();
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
	}

	@Override
	protected void onStart() {
		// TODO Auto-generated method stub
		super.onStart();
	}

	@Override
	protected void onStop() {
		// TODO Auto-generated method stub
		super.onStop();
	}
}
